package com.orangelife.webservice.service.commquery;

import java.net.URI;
import java.net.URISyntaxException;

import org.apache.commons.dbcp.BasicDataSource;
import org.flywaydb.core.Flyway;

public class FlyWay {

	
	
	public static void main(String[] args) {
		Flyway flyway = new Flyway();
		
		BasicDataSource b=new BasicDataSource();
		b.setUrl("jdbc:mysql://localhost/sss?autoReconnect=true&useUnicode=true&zeroDateTimeBehavior=convertToNull&characterEncoding=utf-8");
		b.setPassword("tobaby");
		b.setUsername("root");
		
		 URI uri;
		try {
			uri = new URI("mysql://root:tobaby@localhost:3306/sss?autoReconnect=true&useUnicode=true&zeroDateTimeBehavior=convertToNull&characterEncoding=utf-8#ppp");
			
//			uri.getClass().getMethods()
			
			
//			for (Method string : uri.getClass().getMethods()) {
//				
//				try {
//				//	System.out.println(string.getName()+"*******"+string.invoke(uri));
//					
//					
//				} catch (IllegalAccessException e) {
//					// TODO Auto-generated catch block
//					e.printStackTrace();
//				} catch (IllegalArgumentException e) {
//					// TODO Auto-generated catch block
//					e.printStackTrace();
//				} catch (InvocationTargetException e) {
//					// TODO Auto-generated catch block
//					e.printStackTrace();
//				}
//				
//			}
//			System.out.println(uri.getHost());
//			System.out.println(uri.getRawAuthority());
//			System.out.println(uri.getAuthority());
//			System.out.println(uri.getScheme());
//			System.out.println(uri.getQuery());
//			System.out.println(uri.getRawPath());
//			System.out.println(uri.getRawPath());
//			System.out.println(uri.getRawPath());
//			System.out.println(uri.getRawPath());
//			System.out.println(uri.getRawPath());
			
		} catch (URISyntaxException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

          //		flyway.sets
	      //flyway.setSchemas("wx133");
	      //flyway.setSchemas();
		  //flyway.setDataSource(b);
         //		flyway.baseline();
		//flyway.repair();
		
//	System.out.println(flyway.getSchemas().length);
//		//flyway.migrate();
//		MigrationInfoService m=	flyway.info();
//		for (MigrationInfo mf : m.all()) {
//			
//			System.out.println(mf.getScript());
//			
//		}
	}
}
